1 Initialization

1.1 Read Logs and Create Data Container Objects


In [19]:
%matplotlib inline
import LogReader as lr
import LogDataStructures as ls
fieldopt_path = "/home/einar/Documents/GitHub/PCG/FieldOpt/"
output_dir_path = "/home/einar/Documents/GitHub/PCG/fieldopt_output/adgprs5/"
hdf5_summary_file_name = "5SPOT.SIM.H5"
reader = lr.LogReader(output_dir_path)
case_container = ls.CaseContainer(reader.case_log, reader.property_uuid_name_map)
optimizer = ls.Optimizer(reader.optimization_log, case_container)
simulator = ls.Simulator(reader.simulation_log)


WARNING: Appended an unevaluated latest case.

1.2 Read COMPDAT Log and Store it in the compdat_map Dictionary


In [20]:
compdat_log_path = "/home/einar/Documents/GitHub/PCG/fieldopt_output/log_compdat.out"
compdat_file_lines = []
with open(compdat_log_path, 'r') as f:
    compdat_contents = f.read()
    compdat_file_lines = compdat_contents.split("\n")

compdat_map = {}
l = 0
while l < len(compdat_file_lines):
    if len(compdat_file_lines[l].strip()) == 0: # Skip line if it contains only whitespace
        l = l+1
    elif compdat_file_lines[l].split(':')[0] == 'UUID': # found a new case
        uuid = compdat_file_lines[l].split(' ')[1]
        l = l+1
        
        compdat_entry = ""
        while compdat_file_lines[l].strip() != '/': # loop until end of the compdat
            compdat_entry = compdat_entry + compdat_file_lines[l] + '\n'
            l = l+1
        compdat_entry = compdat_entry + '/\n'
        compdat_map[uuid] = compdat_entry
    else: 
        l = l+1

1.2 Extract COMPDAT for Best Case


In [22]:
print(compdat_map[optimizer.best_case_pr_iteration[-1].uuid])


---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-22-e8eddfe3ee01> in <module>()
----> 1 print(compdat_map[optimizer.best_case_pr_iteration[-1].uuid])

KeyError: '{7077e953-b183-4045-8592-545af4d85fb8}'

1.3 Extract Interesting Wells